package com.app.util;



import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

import com.app.G;

	/*SQLite只支持常见的5种存储类，
		NULL
		INTEGER  --整型
		REAL      --浮点数
		TEXT      --文本
		BLOB      --大二进制对象
	*/
	/*SQLite的SQL查询语句
	 * 
	 */
/*
 * DatabaseHelper负责创建数据库;
 */
public class DatabaseHelper extends SQLiteOpenHelper{
	private static DatabaseHelper mInstance = null;
	
	// String DATABASE_NAME ="";
	static final int DATABASE_VERSION = 2;
	

	
	public static synchronized DatabaseHelper getInstance(Context context) {
        if (mInstance == null) {
        		mInstance = new DatabaseHelper(context, 
        				G.PATH_DB+"/database.db", null, DATABASE_VERSION);
        }
        return mInstance;
    }

	
	public DatabaseHelper(Context context, String name,
			CursorFactory factory, int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
		
	}


	@Override
	public void onCreate(SQLiteDatabase arg0) {
		// TODO Auto-generated method stub
//		System.out.println("onCreate Table");
//		createTrackTable(arg0);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
		// TODO Auto-generated method stub
		System.out.println("onUpgrade");
//		if ( arg1 <= 1) {
//    		dbUpgradeToV2(arg0);
//    	}  
		
	}

}


